package io;

import java.io.*;

/**
 * 使用缓冲字符输入流BufferedReader按行读取字符串
 * 内部维护了一个 8K 的缓冲区8192长的char串数组
 */
public class BrDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("./src/io/BrDemo.java");
        InputStreamReader isr=new InputStreamReader(fis);
        BufferedReader br=new BufferedReader(isr);

        String line;
        while ((line= br.readLine())!=null){//.readLine()读取一行，返回字符串，如果为空，返回null
            System.out.println(line);
        }
        br.close();



    }
}
